class Outclass{
    private int a;
    static int b;
    int c;
    public void methodA(){
        a = 10;
        System.out.println(a);
    }

    public static void methodB(){
        System.out.println(b);
    }

    //实例内部类
    class Interclass{
        int c;
        public static final int d = 6;
        public void methodInner(){
            //在实例内部类中可以直接访问外部类中任意访问修饰符的成员
            a = 100;
            b = 200;
            methodA();
            methodB();

            //如果外部类和实例内部类中具有相同名称的成员时，有限访问的是内部类自己的
            c = 300;
            System.out.println(c);

            //如果要访问外部类同名成员的时候，必须：外部类名称.this.同名成员名字
            Outclass.this.c = 400;
            System.out.println(Outclass.this.c);



        }
    }
}
public class demo {
    public static void main(String[] args) {
        Outclass outclass = new Outclass();
        System.out.println(outclass.b);
        outclass.methodA();
        Outclass.methodB();
        System.out.println("===============");
        Outclass.Interclass interclass = outclass.new Interclass();

    }
}
